package com.hayrullah.cinema.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "Customer_table")
public class Customer extends AbstractEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String customername;
	private String gender;
	@OneToMany(mappedBy = "customer", fetch = FetchType.EAGER)
	private Set<Ticket> ticket;
	@ManyToMany(mappedBy = "customer")
	private Set<Movie> movies;

	public Customer() {
		this.movies = new HashSet<Movie>();
		this.ticket = new HashSet<Ticket>();

	}

	@Column(name = "Customer_name", nullable = false)
	public String getCustomername() {
		return customername;
	}

	public void setCustomername(String customername) {
		this.customername = customername;
	}

	@Column(name = "Customer_name", nullable = false)
	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Set<Ticket> getTicket() {
		return ticket;
	}

	public void setTicket(Set<Ticket> ticket) {
		this.ticket = ticket;
	}

	public Set<Movie> getMovies() {
		return movies;
	}

	public void setMovies(Set<Movie> movies) {
		this.movies = movies;
	}

}
